<?php

/**
 * lastComments actions.
 *
 * @package    cpfaizenay
 * @subpackage player
 * @author     Manu
 * @version    1.0
 */
class lastCommentsActions extends sfActions
{
 /**
  * Executes index action
  *
  * @param sfRequest $request A request object
  */
  public function executeIndex(sfWebRequest $request) {
//      $this->pager = new sfDoctrinePager('Comment', sfConfig::get('app_lastComments_max_comments'));
//      $this->pager->setQuery(Doctrine::getTable('Comment')->getLastComments());
//      $this->pager->setPage($request->getParameter('page', 1));
//      $this->pager->init();
//      $this->last_comments_list = $this->pager;
      $this->last_comments_list = Doctrine_Manager::getInstance()->getCurrentConnection()->fetchAssoc(Doctrine::getTable('Comment')->getLastComments(sfConfig::get('app_lastComments_max_comments', 25)));

      isicsBreadcrumbs::getInstance()->addItem('Derniers commentaires', '#');

      $response = $this->getResponse();
      Utils::setSlogTitle('Derniers commentaires', $response);
  }
}